//
//  BaseTabBarViewController.m
//  ProductB
//
//  Created by lanou on 16/5/27.
//  Copyright © 2016年 ChenZheng. All rights reserved.
//

#import "BaseTabBarViewController.h"
#import "HomePageTableViewController.h"
#import "AssistantViewController.h"
#import "MessageViewController.h"
#import "MainViewController.h"
//消息界面的导航栏类
#import "MessageNaviViewController.h"
//
#import "MineNavViewController.h"
@interface BaseTabBarViewController ()

/**
 message界面的导航栏属性
 */
@property (nonatomic , strong) MessageNaviViewController *messageNavi;
@end

@implementation BaseTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setTabBarBaseView];
   
}
#pragma mark--------tabbar的基本设置----
-(void)setTabBarBaseView{
    //HomePage视图控制器
    HomePageTableViewController *homepageVc = [[HomePageTableViewController alloc]init];
    homepageVc.view.backgroundColor = [UIColor orangeColor];
    homepageVc.tabBarItem.title = @"主页";
    
    //Assistant视图控制器
    AssistantViewController *assistantVc = [[AssistantViewController alloc]init];
    UINavigationController *assNav = [[UINavigationController alloc]initWithRootViewController:assistantVc];
    assNav.view.backgroundColor = [UIColor whiteColor];
    assNav.tabBarItem.title = @"助手";
  
    
    
    //Message视图控制器
    MessageViewController *messageVc = [[MessageViewController alloc]init];
    messageVc.view.backgroundColor = [UIColor cyanColor];
    
    self.messageNavi = [[MessageNaviViewController alloc]initWithRootViewController:messageVc];
    messageVc.navigationItem.title = @"好玩";
    messageVc.navigationController.navigationBar.translucent = NO;
    _messageNavi.tabBarItem.title = @"好玩";
    //main视图控制器
    MainViewController *mainVc = [[MainViewController alloc]init];
//    mainVc.view.backgroundColor = [UIColor blueColor];
    MineNavViewController *mineNav = [[MineNavViewController alloc]initWithRootViewController:mainVc];
    mainVc.navigationController.navigationBar.translucent = NO;
    mineNav.tabBarItem.title = @"我的";
    mainVc.navigationItem.title = @"我的";
    //添加子视图控制器
    [self addChildViewController:homepageVc];
    [self addChildViewController:assNav];
    [self addChildViewController:messageVc];
    [self addChildViewController:mainVc];
    [self addChildViewController:assistantVc];
    [self addChildViewController:_messageNavi];
    [self addChildViewController:mineNav];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
